package com.secret.chain.secretchain.mapper;

import com.secret.chain.secretchain.domain.entity.Address;
import com.secret.chain.secretchain.domain.entity.Problem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface ProblemMapper {


    @Select("select * from problem where answer_user_id = #{answerUserId}")
    Problem queryByGroupAnswerUserId(Integer id);

    @Select("select * from problem where ask_user_id = #{askUserId}")
    Problem queryByGroupAskUserId(Integer id);



    @Select("select * from chain_problem where id = #{id}")
    Problem queryById(Integer id);
    @Select("select * from chain_problem where group_id = #{groupId}")
    Problem queryByGroupId(Integer id);

    void insert(String hash,String address);

    @Delete("delete from chain_problem where id = #{id}")
    void delete(Integer id);

    void update(Address address);
}
